Results 1 to 2 of 2

Thread: dbStartUp="Filter" not working the second time!!

  1. #1
    Yash Varma Guest

    dbStartUp="Filter" not working the second time!!

    Hiya all,

    I have a quick question about the dbstartup="Filter". I have the following code which takes a parameter which is passed to the page to see the page should start with the filter screen. If the parameter = "srch" then it should show the filter screen otherwise the grid.

    The problem I have is that this works fine the first time this page is called but from then on it always defaults to the grid !!! It must be something silly but if anyone has any ideas I would be very appreciative.

    the code looks something like this

    if Session("option&#34 = "srch" then
    MyDb.dbStartUp="Filter"
    end if

  2. #2
    John Guest

    dbStartUp="Filter" not working the second time!! (reply)

    Hi Yash,

    Couple of things:

    1) You're passing a parameter to your "second" program to tell it to start in Search mode. That parm is passed on the URL line right? Well, the first time someone clicks an ASP-db navigation button, the URL will be "overwritten" and your parm will be gone. Therefore you need to save it in a session variable like this:

    If Request(&#34;srch&#34 <> &#34;&#34; then Session(&#34;mySrch&#34 = Request(&#34;srch&#34

    Then do your if check on Session(&#34;mySrch&#34


    2) You say, &#34;after the first time it&#39;s called it defaults to grid&#34;. You may wish to do a dbReset when you detect that you&#39;ve been passed the parameter also. It would make your code look like this:

    If Request(&#34;srch&#34 <> &#34;&#34; then
    Session(&#34;mySrch&#34 = Request(&#34;srch&#34
    Mydb.dbReset(123) &#39; Where 123 is your unit number
    End If

    This code obviously goes after you&#39;ve created the &#34;Mydb&#34; object and before the call to ASP-dbPro.

    Good luck,
    John


    On 2/18/99 4:24:37 AM, Yash Varma wrote:
    > Hiya all,

    I have a quick question about the dbstartup=&#34;Filter&#34;.
    > I have the following code which takes a parameter which is passed to the
    > page to see the page should start with the filter screen. If the parameter
    > = &#34;srch&#34; then it should show the filter screen otherwise the
    > grid.

    The problem I have is that this works fine the first time this
    > page is called but from then on it always defaults to the grid !!! It must
    > be something silly but if anyone has any ideas I would be very
    > appreciative.

    the code looks something like this

    if
    > Session(&#34;option&#34 = &#34;srch&#34; then
    MyDb.dbStartUp=&#34;Filter&#34;
    end if

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •